package cn.stylefeng.guns.modular.lx.mapper;

import cn.stylefeng.guns.modular.lx.entity.LxSpZw;
import cn.stylefeng.guns.modular.lx.model.params.LxDdWzhParam;
import cn.stylefeng.guns.modular.lx.model.params.LxDdZwParam;
import cn.stylefeng.guns.modular.lx.model.params.LxSpZwParam;
import cn.stylefeng.guns.modular.lx.model.result.LxSpZwResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zw
 * @since 2023-12-01
 */
public interface LxSpZwMapper extends BaseMapper<LxSpZw> {

    /**
     * 获取列表
     *
     * @author zw
     * @Date 2023-12-01
     */
    List<LxSpZwResult> customList(@Param("paramCondition") LxSpZwParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zw
     * @Date 2023-12-01
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") LxSpZwParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zw
     * @Date 2023-12-01
     */
    Page<LxSpZwResult> customPageList(@Param("page") Page page, @Param("paramCondition") LxSpZwParam paramCondition, @Param("condition") String condition);


    /**
     * 获取分页map列表
     *
     * @author zw
     * @Date 2023-12-01
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") LxSpZwParam paramCondition);


    @Update("update lx_sp_zw set chl=chl-#{buyNum} where id=#{id}")
    void reducechl(int id, int buyNum);

}
